package Articulo.src.business.entities;

import java.io.Serializable;

public class Article implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name, descr;
	private int price, primaryKey;
	private Ingredient[] ingr;
	private Category cat;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescr() {
		return descr;
	}

	public void setDescr(String descr) {
		this.descr = descr;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public Ingredient[] getIngr() {
		return ingr;
	}

	public void setIngr(Ingredient[] ingr) {
		this.ingr = ingr;
	}

	public Category getCat() {
		return cat;
	}

	public void setCat(Category cat) {
		this.cat = cat;
	}

	public int getPrimaryKey() {
		return primaryKey;
	}

	public void setPrimaryKey(int primaryKey) {
		this.primaryKey = primaryKey;
	}

	public Article(String name, String descr, int price, Ingredient[] ingr,
			Category cat) {
		this.name = name;
		this.descr = descr;
		this.price = price;
		this.ingr = ingr;
		this.cat = cat;
	}

	public String toString() {
		String aux = "";
		for (Ingredient s : this.ingr)
			aux += s.toString() + " ";
		return this.name + "," + this.descr + "," + this.price + ","
				+ this.cat.toString() + "," + aux;
	}
	
	public String toStringIngredient(Ingredient[] ing){
		String aux = "";
		for(Ingredient e : ing){
			aux+=e.toString()+" ";
		}
		return aux;
	}
	
	

}